package cn.tedu.cgb2110boot01;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//Servlet程序想要浏览器访问，@WebServlet规定了浏览器的访问方式
@WebServlet("/Servlet1")

//1，Servlet程序的实现标准，就有三种方式:implements Servlet,extends GenericServlet,extends HttpServlet
    public class Servlet1 extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //3.doPost()用来处理那些post的请求（method=post）
        System.out.println("doPost...");
    }
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //doGet处理get请求
        System.out.println("doGet");
    }
}
